package main

import (
	"github.com/gin-gonic/gin"
	"week2/AppConfig"
	"week2/Router"
	"week2/iniitialize"
)

func main() {
	//配置文件读取
	AppConfig.InitApp()
	//mysql数据库连接
	iniitialize.InitMysql()
	//redis 连接
	iniitialize.InitRedis()

	// 1.创建路由
	r := gin.Default()
	// 2.绑定路由规则，执行的函数
	// gin.Context，封装了request和response
	Router.Router(r)
	// 3.监听端口，默认在8080
	// Run("里面不指定端口号默认为8080")
	r.Run(":8000")
}
